package cn.school.controller.workflow;

import cn.school.common.api.CommonPage;
import cn.school.common.api.CommonResult;
import cn.school.common.exception.ApiException;
import cn.school.workflow.service.StudentLeaveStatisticsService;
import cn.school.workflow.vo.StudentLeaveApplyVO;
import cn.school.workflow.vo.StudentLeaveStatisticsVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/studentLeaveStatistics")
public class studentLeaveStatisticsController {
    @Autowired
    StudentLeaveStatisticsService studentLeaveStatisticsService;

    /**
     * 查询学生请假信息（代提）
     * @return
     * @throws ApiException
     */
    @PostMapping("/pageList")
    public CommonResult<CommonPage<StudentLeaveStatisticsVo>> findStudentLeaveApplyPageList(@RequestBody StudentLeaveStatisticsVo vo) throws ApiException {
        IPage<StudentLeaveStatisticsVo> pageList =  studentLeaveStatisticsService.findStudentLeaveApplyPageList(vo);
        return  CommonResult.success(CommonPage.restPage(pageList));
    }

}
